﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Justin.Stock.Entities;

namespace Justin.Stock.Models
{
    public interface IRequest
    {
        void RefreshStockData(List<StockInfo> stocks);
        List<Tuple<string, string, string>> GetAllStocks();

    }

    public class RequestFactory
    {
        public static IRequest GetRequest(DataSource ds)
        {
            if (ds == DataSource.Sina)
            {
                return new SinaRequest();
            }
            else if (ds == DataSource.Tencent)
            {
                return new TencentRequest();
            }
            else if (ds == DataSource.EastMoney)
            {
                return new EastMoneyRequest();
            }
            return new SinaRequest();
        }
    }

    public enum DataSource
    {
        Sina,
        Tencent,
        EastMoney,
    }
}
